package com.lucy.nepu.module.taward.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lucy.common.converter.JpaColumnConverter;
import com.lucy.common.core.BaseEntity;
import com.lucy.nepu.module.topic.converter.ExtParamsConverter;
import com.lucy.nepu.module.topic.model.ExtParams;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Getter
@Setter
@ToString
@RequiredArgsConstructor
@Entity
@Table(name = "nepu_taward")
public class TAward extends BaseEntity implements Serializable {
    @ApiModelProperty("周期ID")
    @Column(name = "period_id")
    String periodId;



    /**
     * 奖励词典ID
     */
    @ApiModelProperty(value = "奖励词典ID",notes = "")
    @Column(name = "award_dict_id")
    String awardDictId;

    @ApiModelProperty(value = "获奖内容名称",notes = "")
    @Column(name = "award_name")
    String awardName;

    /**
     * 我校署名单位等级：一、二、三
     */
    @ApiModelProperty(value = "我校署名单位等级",notes = "")
    @Column(name = "signature_grade")
    String signatureGrade;



    /**
     * 负责人姓名
     */
    @ApiModelProperty(value = "负责人",notes = "")
    @Column(name = "leader")
    String leader;

    /**
     * 负责人ID
     */
    @ApiModelProperty(value = "负责人ID",notes = "")
    @Column(name = "leader_id")
    Long leaderId;

    /**
     * 获奖日期
     */
    @ApiModelProperty(value = "获奖日期",notes = "获奖日期，如2021/11/16")
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    @Column(name = "award_date")
    Date awardDate;

    /**
     * 参与成员ID列表
     */

    @ApiModelProperty(value = "参与成员ID列表",notes = "")
    @Convert(converter = JpaColumnConverter.class)
    @Column(name = "user_id_list")
    List<Long> userIdList;

    @ApiModelProperty(value = "工作量",notes = "")
    @Column(name = "workload",scale = 2)
    Double workload;

    @Convert(converter = ExtParamsConverter.class)
    @ApiModelProperty("拓展参数")
    @Column(name = "ext_params")
    ExtParams extParams;

    /**
     * 关联文件列表
     */
    @Convert(converter = JpaColumnConverter.class)
    @ApiModelProperty(value = "关联文件ID列表")
    @Column(name = "file_ids")
    List<String> fileIds;

    /**
     * 0. 关闭状态 -- 可以删除
     * 1. 正常状态 -- 可以删除
     * 2. 已经登记工作量 -- 锁定无法操作
     */
    @ApiModelProperty("记录状态")
    @Column(name = "status")
    Integer status;
}
